import { Component, OnInit, ViewChild, Input } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { DataService } from '../../../services/data.service';

@Component({
  selector: 'app-detail',
  templateUrl: './detail.component.html',
  styleUrls: ['./detail.component.scss']
})
export class OnetooneDetailComponent implements OnInit {

  public list = [];
  
    public operate = "edit";
  
    public iswhat = sessionStorage.getItem('oto_isStop');//判断是否为已终止产品
  
    constructor(
      private route: ActivatedRoute,
      private dataService: DataService//构造dataService
    ) {
      this.route.params.subscribe((data) => {
        this.operate = data.operate;
      });
    }
  
    showHisListModal() {
      window['$']("#detail-his-list-modal").modal();
    }
  
  

    ngOnInit() {

      this.route.params.subscribe((data:any) => {
        this.operate = data.operate;
      });
    }
    
    ngAfterViewInit() {
      // 指定单列不排序
    window['$']('.datatable-control-custom').DataTable({
      "paging": false,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": false,
      "autoWidth": false,
      "columnDefs":[
        { 
          //"searchable": false,
          "orderable": false, 
          "targets": 4
        }
      ]
    });
   }

}
